import {request} from "../request/index.js";
import {config} from "../config/index.js";

const loginByPhone = async function (phone, password,callBack, handle) {
    let params = {
        phone,
        password
    }
    await request.get(config.url.loginUrls.loginByPhone,params).then(callBack).catch(handle)
}

const loginByEmail = async function(email, password, callBack, handle) {
    let params = {
        email,
        password
    }
    await request.get(config.url.loginUrls.loginByEmail,params).then(callBack).catch(handle)
}

export const loginApi = {
    loginByPhone,
    loginByEmail
}